﻿using System;
using System.Windows.Forms;

namespace PlaxoSyncWM {
    public partial class MainForm : Form {
        private readonly ParseWebResponse parser = null;
        public string password, username;

        public String guidURL =
            "http://testapi.plaxo.com/rest?package=['Header',%20'ProtoVer',%20'1','Client',%20'Dev%20Clientname/1.0',%20'OS',%20'windows/service%20pack%20infinity',%20'Platform',%20'Outlook/2005']%0a['/Header']%0a['CreateGUID']%0a['/CreateGUID']";

        public IdDeltas idDeltas;
        public Settings settings;

        public MainForm() {
            InitializeComponent();
            parser = new ParseWebResponse();
            settings = new Settings();
        }

        private void MainForm_Load(object sender, EventArgs e) {}

        private void saveAccountDetails_Click_1(object sender, EventArgs e) {
            Cursor.Current = Cursors.WaitCursor;
            username = txtbox_username.Text;
            password = txtbox_password.Text;
            string guid = parser.getGuid(guidURL);
            settings.SaveSetting("username", username);
            settings.SaveSetting("password", password);
            settings.SaveSetting("GUID", guid);
            SyncForm sf = new SyncForm();
            Cursor.Current = Cursors.Default;
            sf.Show();
        }
    }
}